# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=ytnef
pkgver=2.0
pkgrel=0
pkgdesc="TNEF Stream Reader - for winmail.dat files"
url="https://github.com/Yeraze/ytnef"
arch="all"
license="GPL+"
makedepends="autoconf automake libtool file"
subpackages="$pkgname-dev $pkgname-libs"
source="$pkgname-$pkgver.tar.gz::https://github.com/Yeraze/ytnef/archive/v$pkgver.tar.gz
	ytnef-pkgconfig.patch
	"

# secfixes:
#   1.9.3-r1:
#     - CVE-2021-3403
#     - CVE-2021-3404

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--disable-static
	make
}

check() {
	make check
}

package() {
	make install DESTDIR="$pkgdir" includedir=/usr/include/libytnef
}

sha512sums="
9ceba15a774f552911779859b7de11baddb7f980b0e8751c02a0c27275fa5624a4d4d24177bb4edba243acf3a9c5b89ddbbed1e759a330794bed8b2da63ffeb6  ytnef-2.0.tar.gz
bf829bd56fff81f30ad32da4714677224b537cf38fb084afe73fd2d5723f73741e0423149832d9f61c0e368781040fd29e66f22c1c6c099d6d300f0649d6ba47  ytnef-pkgconfig.patch
"
